package com.bootdo.coach.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.bootdo.coach.dao.TabDeviceTypeMapper;
import com.bootdo.coach.dao.ext.ExtTabDeviceTypeMapper;
import com.bootdo.coach.domain.TabDeviceType;
import com.bootdo.coach.service.TabDeviceTypeService;
import com.bootdo.coach.vo.TabDeviceVo;


@Service
public class TabDeviceTypeServiceImpl implements TabDeviceTypeService {
    @Autowired
    private TabDeviceTypeMapper mapper;
    
    @Autowired
    private ExtTabDeviceTypeMapper extMapper;

	@Override
	public int deleteByPrimaryKey(Integer deviceTypeId) {
		return mapper.deleteByPrimaryKey(deviceTypeId);
	}

	@Override
	public int insert(TabDeviceType record) {
		return mapper.insert(record);
	}

	@Override
	public int insertSelective(TabDeviceType record) {
		return mapper.insertSelective(record);
	}

	@Override
	public TabDeviceType selectByPrimaryKey(Integer deviceTypeId) {
		return mapper.selectByPrimaryKey(deviceTypeId);
	}

	@Override
	public int updateByPrimaryKeySelective(TabDeviceType record) {
		return mapper.updateByPrimaryKeySelective(record);
	}

	@Override
	public int updateByPrimaryKey(TabDeviceType record) {
		return mapper.updateByPrimaryKey(record);
	}
	
	@Override
	public int count(Map<String, Object> query) {
		return extMapper.count(query);
	}

	@Override
	public List<TabDeviceType> list(Map<String, Object> query) {
		return extMapper.list(query);
	}
	
	@Override
	public boolean exitDeviceTypeName(Map<String, Object> params) {
		boolean exit;
        exit = extMapper.list(params).size() > 0;
        return exit;
	}
    
}
